import cv2 as cv
import numpy as np

img = cv.imread('../resources/miku.jpg')

pts =  np.array([[0, 0], [0, 100], [100, 100], [100, 0]], dtype=np.int32)
cv.drawContours(img, [pts], 0, (0, 0, 255), -1)#3) # 负数时填充
# drawContours(img, contours, contourIdx, color, thickness, lineType, hierarchy, maxLevel, offset)
# 集成了cv.fillPoly 与 cv.polylines 的功能
cv.imshow('img', img)
cv.waitKey(0)
cv.destroyAllWindows()